/*
 *  Copyright 2016 http://www.kedacomframework.org
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */
package com.kedacom.ctsp.authority.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;

import javax.persistence.*;

/**
 * 人员
 *
 * @author
 */
@Data
@Entity
@Table(name = "person")
public class SimplePerson implements Person {
    /**
     * 主键id ，自增长
     */
    @Id
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    @ApiModelProperty("主键id")
    private String id;

    /**
     * 所属部门
     */
    @ManyToOne(fetch = FetchType.EAGER, targetEntity = SimpleDepartment.class)
    @JoinColumn(name = "department_id")
    private Department department;

    /**
     * 姓名
     */
    @NotBlank
    private String name;
    /**
     * 人员编码
     */
    private String code;
    /**
     * 性别
     */
    private Byte sex;
    /**
     * 电子邮箱
     */
    @Email
    private String email;
    /**
     * 职位
     */
    private String position;
    /**
     * 联系电话
     */
    private String phone;
    /**
     * 照片
     */
    private String photo;
    /**
     * 备注
     */
    private String remark;


    /**
     * 状态
     */
    private Integer status;

    /**
     * 创建者
     */
    private String creatorCode;
    private Long createTime;
    private String creatorName;

    /**
     * 更新者
     */
    private String updaterCode;
    private Long updateTime;
    private String updaterName;


    private String createDeptCode;
    private String createDeptName;

    /**
     * 扩展字段
     */
    @Column(length = 4000)
    private String extendedField;
    /**
     * 身份证号码
     */
    private String identity;


}